<?php require_once 'appinclude.php'; ?>

<style>
<?php echo htmlentities(file_get_contents('mystyle.css', true)); ?>
</style>

<?php

//require_once 'appinclude.php';


echo '<script type="text/javascript" src="niftycube.js"></script>';
echo '<script type="text/javascript"> window.onload=function(){Nifty("div#box", "transparent");}</script>';


// user ID is outputed
echo '<div id="box">';
echo "<p>$user</p>";
echo '<p>Hello World!  <fb:name uid=\"$user\"/></p>';

echo "<p> you have several friends: </p>";
$friends = $facebook->api_client->friends_get();
echo "<ul>";
foreach ($friends as $friend) {
	echo "<li>$friend</li>";
}

echo "<ul>";
echo "</div>";
if (isset($_REQUEST['profiletext'])) {
  $facebook->api_client->profile_setFBML($_REQUEST['profiletext'], $user);
  $facebook->redirect($facebook->get_facebook_url() . '/profile.php');
}

echo '<form action="" method="get">';
echo '<input name="profiletext" type="text" size="30" value=""><br>';
echo '<input name="submit" type="submit" value="Display text on profile">';
echo '</form>';
?>